package top.chatgqt.SmartChargeStation.demo.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.chatgqt.SmartChargeStation.demo.mqtt.FacoryMode.service.MqttService;

@RestController
public class MqttFactoryController {

    @Resource
    private MqttService service;


    //mqtt客户端发送消息
    @RequestMapping(value = "/factory/pub")
    public void pahoPub(
            @RequestParam("topic") String topic,
            @RequestParam("message") String message) {

        service.send(topic,message);
    }

}
